![]() |
ALMaSS
1.0
The Animal, Landscape and Man Simulation System
|
Base class for all partridge classes. More...
#include <Partridge_All.h>
Public Member Functions | |
Partridge_Object | GetObjectType () |
Supply object type. More... | |
bool | GetUncleStatus () |
Supply uncle status. More... | |
void | SetUncleStatus (bool a_Status) |
Set uncle status. More... | |
bool | PossibleMate (Partridge_Base *a_partridge) |
Can we mate? More... | |
virtual bool | ArePaired () |
Overridden base function. More... | |
Partridge_Covey * | GetCovey (void) |
Supply covey pointer. More... | |
Partridge_State | GetState (void) |
Supply state. More... | |
void | SetState (Partridge_State a_pars) |
Set state. More... | |
int | GetFamily (void) |
Supply family ID. More... | |
int | GetAge (void) |
Supply age. More... | |
void | SetAge (int a_age) |
Set age. More... | |
long | GetID (void) |
Supply ID. More... | |
void | SetFamily (unsigned int family) |
Set family ID. More... | |
void | SetCovey (Partridge_Covey *a_covey) |
Set covey pointer. More... | |
void | MakeCovey () |
Create our own covey. More... | |
void | SwitchCovey (Partridge_Covey *a_covey) |
Swap coveys. More... | |
Partridge_Base (int a_born_x, int a_born_y, int a_x, int a_y, int a_family_counter, Partridge_Covey *a_covey, Landscape *a_map, Partridge_Population_Manager *a_manager) | |
Constructor for Partridge_Base. More... | |
virtual | ~Partridge_Base (void) |
Destructor. More... | |
virtual void | CopyMyself (int a_Ptype) |
Duplicate this object. More... | |
![]() | |
unsigned | SupplyFarmOwnerRef () |
AnimalPosition | SupplyPosition () |
APoint | SupplyPoint () |
int | SupplyPolygonRef () |
int | Supply_m_Location_x () |
int | Supply_m_Location_y () |
virtual void | KillThis () |
virtual void | CopyMyself () |
void | SetX (int a_x) |
void | SetY (int a_y) |
TAnimal (int x, int y, Landscape *L) | |
virtual void | BeginStep (void) |
BeingStep behaviour - must be implemented in descendent classes. More... | |
virtual void | Step (void) |
Step behaviour - must be implemented in descendent classes. More... | |
virtual void | EndStep (void) |
EndStep behaviour - must be implemented in descendent classes. More... | |
virtual void | ReinitialiseObject (int x, int y, Landscape *L) |
Used to re-use an object - must be implemented in descendent classes. More... | |
virtual int | WhatState () |
virtual void | Dying () |
void | CheckManagement (void) |
void | CheckManagementXY (int x, int y) |
virtual bool | OnFarmEvent (FarmToDo) |
![]() | |
int | GetCurrentStateNo () |
Returns the current state number. More... | |
void | SetCurrentStateNo (int a_num) |
Sets the current state number. More... | |
bool | GetStepDone () |
Returns the step done indicator flag. More... | |
void | SetStepDone (bool a_bool) |
Sets the step done indicator flag. More... | |
virtual void | ReinitialiseObject () |
Used to re-use an object - must be implemented in descendent classes. More... | |
TALMaSSObject () | |
The constructor for TALMaSSObject. More... | |
virtual | ~TALMaSSObject () |
The destructor for TALMaSSObject. More... | |
void | OnArrayBoundsError () |
Used for debugging only, tests basic object properties. More... | |
Public Attributes | |
Partridge_Population_Manager * | m_OurPopulationManager |
Pointer to the population manager. More... | |
Protected Member Functions | |
virtual bool | DailyMortality () |
Background mortality test. More... | |
virtual void | CheckMatePointers () |
Debug. More... | |
![]() | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
Protected Attributes | |
int | m_signal |
Used to pass information to outputs. More... | |
long | m_id |
Individual bird ID. More... | |
int | m_family_counter |
Family ID. More... | |
int | m_age |
Age in days. More... | |
int | m_born_x |
x-coord of birth More... | |
int | m_born_y |
y-coord of birth More... | |
bool | m_UncleStatus |
If has uncle status in the covey. More... | |
Partridge_Object | m_object_type |
Type of pob object this is. More... | |
Partridge_Covey * | m_covey |
Pointer to the covey. More... | |
Partridge_State | m_state |
Current behavioural state. More... | |
![]() | |
int | m_Location_x |
int | m_Location_y |
Landscape * | m_OurLandscape |
![]() | |
int | m_CurrentStateNo |
The basic state number for all objects - '-1' indicates death. More... | |
bool | m_StepDone |
Indicates whether the iterative step code is done for this timestep. More... | |
Base class for all partridge classes.
Partridge_Base::Partridge_Base | ( | int | a_born_x, |
int | a_born_y, | ||
int | a_x, | ||
int | a_y, | ||
int | a_family_counter, | ||
Partridge_Covey * | a_covey, | ||
Landscape * | a_map, | ||
Partridge_Population_Manager * | a_manager | ||
) |
Constructor for Partridge_Base.
If a_flock is NULL, then assume this is an animal created during population manager initialization and that covey creation/addtion is controlled by the calling method.
References Partridge_Covey::AddMember(), g_partridge_id, m_age, m_born_x, m_born_y, m_covey, m_family_counter, m_id, m_OurPopulationManager, m_signal, m_state, m_UncleStatus, and pars_Initiation.
|
virtual |
|
inlinevirtual |
Overridden base function.
Reimplemented in Partridge_Female, and Partridge_Male.
|
inlineprotectedvirtual |
Debug.
Reimplemented in Partridge_Female, and Partridge_Male.
Referenced by Partridge_Clutch::Step().
|
virtual |
Duplicate this object.
A method required only for experimental manipulations - e.g. sudden doubling of population size.
References AdultPartridge_struct::age, Partridge_struct::bx, Partridge_struct::by, Partridge_Population_Manager::CreateCloneObjects(), Partridge_struct::family_counter, Partridge_struct::L, m_age, m_born_x, m_born_y, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, m_OurPopulationManager, pob_Male, random(), AdultPartridge_struct::sex, Partridge_struct::x, and Partridge_struct::y.
Referenced by Partridge_Population_Manager::Catastrophe(), and Partridge_Population_Manager::MaleImmigration().
|
protectedvirtual |
Background mortality test.
This should not really be used.
Reimplemented in Partridge_Female, Partridge_Male, Partridge_Chick2, Partridge_Chick, and Partridge_Clutch.
References cfg_par_base_mortality, random(), and CfgInt::value().
|
inline |
Supply age.
References m_age.
Referenced by Partridge_Population_Manager::DoFirst(), and Partridge_Covey::SupplyChickAge().
|
inline |
Supply covey pointer.
References m_covey.
Referenced by Partridge_Population_Manager::DissolveCovey().
|
inline |
Supply family ID.
References m_family_counter.
Referenced by Partridge_Covey::FindMeAHusband(), Partridge_Covey::FindMeAMateInCovey(), Partridge_Covey::FindMeAWife(), Partridge_Male::OnMating(), and PossibleMate().
|
inline |
|
inline |
Supply object type.
References m_object_type.
Referenced by Partridge_Population_Manager::DissolveCovey(), Partridge_Covey::FindMeAHusband(), Partridge_Covey::FindMeAWife(), and Partridge_Communication::PassMessage().
|
inline |
|
inline |
Supply uncle status.
References m_UncleStatus.
Referenced by Partridge_Population_Manager::DissolveCovey().
void Partridge_Base::MakeCovey | ( | void | ) |
Create our own covey.
Only called when a bird must make a new covey the bird will be the first member and the only one on calling. NB all housekeeping in the population manager is handled by the Covey constructor. The caller is responsible for removing the bird from the present covey before this call is made (or immediately after).
References m_covey, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, and m_OurPopulationManager.
Referenced by Partridge_Population_Manager::DissolveCovey(), and Partridge_Male::MFindingMate().
bool Partridge_Base::PossibleMate | ( | Partridge_Base * | a_partridge | ) |
Can we mate?
Checks whether the supplied bird is a potential mate, or is too closely related.
References GetFamily(), and m_family_counter.
|
inline |
|
inline |
Set covey pointer.
References m_covey.
Referenced by Partridge_Population_Manager::CreateCloneObjects(), Partridge_Population_Manager::CreateInitialObjects(), and Partridge_Covey::ManagerCheckMerge().
|
inline |
|
inline |
Set state.
References m_state.
Referenced by Partridge_Population_Manager::Catastrophe(), and Partridge_Covey::SetUncle().
|
inline |
Set uncle status.
References m_UncleStatus.
Referenced by Partridge_Population_Manager::DissolveCovey(), Partridge_Covey::ManagerCheckMerge(), Partridge_Female::OnWaitForMale(), and Partridge_Covey::SetUncle().
void Partridge_Base::SwitchCovey | ( | Partridge_Covey * | a_covey | ) |
Swap coveys.
Moves the bird from its cuurent covey to the one supplied.
References Partridge_Covey::AddMember(), m_covey, and Partridge_Covey::RemoveMember().
Referenced by Partridge_Female::OnMating().
|
protected |
Age in days.
Referenced by Partridge_Chick::BeginStep(), Partridge_Chick2::BeginStep(), Partridge_Male::BeginStep(), Partridge_Female::BeginStep(), Partridge_Chick::ChDeveloping(), Partridge_Chick2::ChDeveloping(), Partridge_Chick::ChDying(), Partridge_Clutch::ClDeveloping(), CopyMyself(), GetAge(), Partridge_Base(), Partridge_Chick::Partridge_Chick(), and SetAge().
|
protected |
x-coord of birth
Referenced by Partridge_Chick2::ChMaturing(), CopyMyself(), and Partridge_Base().
|
protected |
y-coord of birth
Referenced by Partridge_Chick2::ChMaturing(), CopyMyself(), and Partridge_Base().
|
protected |
Pointer to the covey.
Referenced by Partridge_Male::AmIaMember(), Partridge_Chick::BeginStep(), Partridge_Chick2::BeginStep(), Partridge_Chick::ChDeveloping(), Partridge_Chick::ChDying(), Partridge_Chick::ChMaturing(), Partridge_Chick2::ChMaturing(), Partridge_Clutch::ClDeveloping(), Partridge_Clutch::ClDying(), Partridge_Male::DailyMortality(), Partridge_Female::DailyMortality(), Partridge_Female::FAttractingMate(), Partridge_Female::FCaringForYoung(), Partridge_Female::FDying(), Partridge_Female::FFindingTerritory(), Partridge_Female::FFlocking(), Partridge_Female::FIncubating(), Partridge_Female::FLaying(), Partridge_Female::FMakingNest(), Partridge_Female::FStartingNewBrood(), GetCovey(), MakeCovey(), Partridge_Male::MCaringForYoung(), Partridge_Male::MDying(), Partridge_Male::MFindingMate(), Partridge_Male::MFlocking(), Partridge_Female::OnClutchDeath(), Partridge_Female::OnEggsHatch(), Partridge_Male::OnFemaleGivingUp(), Partridge_Male::OnMateDying(), Partridge_Female::OnMateDying(), Partridge_Female::OnWaitForMale(), Partridge_Base(), Partridge_Chick::Partridge_Chick(), Partridge_Chick2::Partridge_Chick2(), SetCovey(), and SwitchCovey().
|
protected |
|
protected |
Individual bird ID.
Referenced by GetID(), and Partridge_Base().
|
protected |
Type of pob object this is.
Referenced by GetObjectType(), Partridge_Chick::Partridge_Chick(), Partridge_Chick2::Partridge_Chick2(), Partridge_Clutch::Partridge_Clutch(), Partridge_Female::Partridge_Female(), and Partridge_Male::Partridge_Male().
Partridge_Population_Manager* Partridge_Base::m_OurPopulationManager |
Pointer to the population manager.
Referenced by Partridge_Clutch::AgDying(), Partridge_Chick::ChDeveloping(), Partridge_Chick::ChDying(), Partridge_Chick::ChMaturing(), Partridge_Chick2::ChMaturing(), Partridge_Clutch::ClDeveloping(), Partridge_Clutch::ClDying(), CopyMyself(), Partridge_Chick2::DailyMortality(), Partridge_Male::DailyMortality(), Partridge_Female::FAttractingMate(), Partridge_Female::FDying(), Partridge_Female::FFindingTerritory(), Partridge_Female::FIncubating(), Partridge_Female::FLaying(), Partridge_Female::FMakingNest(), Partridge_Female::FStartingNewBrood(), Partridge_Female::GetNestingCoverDensity(), MakeCovey(), Partridge_Male::MDying(), Partridge_Male::MFindingMate(), and Partridge_Base().
|
protected |
Used to pass information to outputs.
Referenced by Partridge_Chick::BeginStep(), Partridge_Chick2::BeginStep(), Partridge_Male::BeginStep(), Partridge_Female::BeginStep(), Partridge_Chick::ChDeveloping(), and Partridge_Base().
|
protected |
Current behavioural state.
Referenced by Partridge_Chick::ChDying(), Partridge_Male::CheckMatePointers(), Partridge_Female::CheckMatePointers(), Partridge_Clutch::ClDying(), Partridge_Female::DailyMortality(), Partridge_Clutch::EndStep(), Partridge_Chick::EndStep(), Partridge_Chick2::EndStep(), Partridge_Male::EndStep(), Partridge_Female::FDying(), Partridge_Female::FIncubating(), Partridge_Female::FLaying(), GetState(), Partridge_Male::MDying(), Partridge_Male::OnChicksDead(), Partridge_Female::OnChicksDead(), Partridge_Male::OnChicksMatured(), Partridge_Female::OnChicksMatured(), Partridge_Female::OnClutchDeath(), Partridge_Female::OnClutchMown(), Partridge_Female::OnEggsHatch(), Partridge_Clutch::OnFarmEvent(), Partridge_Chick::OnFarmEvent(), Partridge_Chick2::OnFarmEvent(), Partridge_Male::OnFarmEvent(), Partridge_Female::OnFarmEvent(), Partridge_Male::OnFemaleGivingUp(), Partridge_Male::OnLookAfterKids(), Partridge_Male::OnMateDying(), Partridge_Female::OnMateDying(), Partridge_Male::OnMating(), Partridge_Female::OnMating(), Partridge_Male::OnMovingHome(), Partridge_Female::OnSetMyClutch(), Partridge_Male::OnStoppingBreeding(), Partridge_Female::OnWaitForMale(), Partridge_Base(), SetState(), Partridge_Male::StartBreedingBehaviour(), Partridge_Clutch::Step(), Partridge_Chick::Step(), Partridge_Chick2::Step(), Partridge_Male::Step(), and Partridge_Female::Step().
|
protected |
If has uncle status in the covey.
Referenced by GetUncleStatus(), Partridge_Male::MFindingMate(), Partridge_Female::OnWaitForMale(), Partridge_Base(), and SetUncleStatus().